﻿
    
<UserControl x:Class="TanzimSaqib.NewsFramework.MainPanorama"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls" mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    xmlns:fx="clr-namespace:TanzimSaqib.NewsFramework;assembly=TanzimSaqib.NewsFramework" 
    fx:Command.Attach="Loaded=MainPanorama_Load"
    Background="{Binding BackgroundImageSource}"
    d:DesignHeight="480" d:DesignWidth="480">

    <UserControl.DataContext>
        <fx:MainPanoramaViewModel />
    </UserControl.DataContext>

    <controls:Panorama fx:Command.Attach="Loaded=LoadPanorama">

        <controls:Panorama.Title>
            <StackPanel Orientation="Horizontal" Margin="0,80,0,0">
                <Image x:Name="icon" Source="/ApplicationIcon.png" Height="51" Width="51" Margin="0,0,10,0"/>
                <TextBlock Text="{Binding PageTitle}" FontStyle="Italic" FontFamily="Segoe WP Bold" FontSize="20" VerticalAlignment="Center"/>
            </StackPanel>
        </controls:Panorama.Title>

        <!--Panorama item two-->
        <!--Use 'Orientation="Horizontal"' to enable a panel that lays out horizontally-->
        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="最近更新" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Latest}" fx:Command.Attach="SelectionChanged=Latest_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <!--<Image Source="{Binding LineTwo}" Height="100" Width="100" />-->
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <!--<StackPanel Width="340">-->
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}"/>
                            <!--</StackPanel>-->
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <!--Panorama item one-->
        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="分类" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Categories}" fx:Command.Attach="SelectionChanged=Categories_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0,0,0,17" Width="432">
                            <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextLargeStyle}"/>
                            <TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="收藏" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with image placeholder and text wrapping-->
            <ListBox Margin="0,0,-12,0" ItemsSource="{Binding Saved}" fx:Command.Attach="SelectionChanged=Saved_SelectionChanged">
                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal" Margin="0,0,0,30" Width="450">
                            <!--Replace rectangle with image-->
                            <!--<Image Source="{Binding LineTwo}" Height="100" Width="100" />-->
                            <!-- <Rectangle Height="100" Width="100" Fill="#FFE5001b" /> -->
                            <!--<StackPanel Width="340">-->
                                <TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextTitle3Style}"/>
                            <!--</StackPanel>-->
                        </StackPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
            </ListBox>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="搜索" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel>
                <TextBox Text="{Binding SearchText}" fx:Command.Attach="TextChanged=SearchText_TextChanged" />
                <Button Content="搜索" fx:Command.Attach="Click=Search_Click" IsEnabled="{Binding CanSearch}" />
            </StackPanel>
        </controls:PanoramaItem>

        <controls:PanoramaItem>
            <controls:PanoramaItem.Header>
                <TextBlock Text="关于" FontFamily="Segoe WP Semibold"  FontSize="40" VerticalAlignment="Center"/>
            </controls:PanoramaItem.Header>
            <!--Double line list with text wrapping-->
            <StackPanel>
 
                <TextBlock TextWrapping="Wrap"> 
                  <Span>&#x2003;博客园阅读器，现有功能包括：</Span><LineBreak/>
                  <Span>&#x2003;&#x2003;博客园首页文章列表。</Span><LineBreak/>
                  <Span>&#x2003;&#x2003;博客园频道的文章列表，查看详细的文章，文章可以在手机上收藏阅读。</Span><LineBreak/>
                  <Span>&#x2003;&#x2003;通过Bing搜索引擎搜索博客园文章。</Span><LineBreak/>
                  <Span>&#x2003;&#x2003;如果您对这个软件有什么意见或建议，请及时与我联系，感谢您的支持。</Span>
                </TextBlock>
              
                <TextBlock TextWrapping="Wrap" TextAlignment="Center">
                   <Span>&#x2003;&#x2003;作者：张善友</Span><LineBreak/>
                </TextBlock>
                <HyperlinkButton Content="捐赠：你可以通过支付宝给我付款" NavigateUri="http://me.alipay.com/geffzhang" TargetName="_blank"></HyperlinkButton>
                <HyperlinkButton Content="邮箱：zhangshanyou@gmail.com" NavigateUri="mailto:zhangshanyou@gmail.com" TargetName="_blank"></HyperlinkButton>
                <HyperlinkButton Content="博客：Http://shanyou.cnblogs.com" NavigateUri="http://shanyou.cnblogs.com" TargetName="_blank" ></HyperlinkButton>
                <HyperlinkButton Content="腾讯微博：http://t.qq.com/geffzhang" NavigateUri="http://t.qq.com/geffzhang" TargetName="_blank"></HyperlinkButton>
                <HyperlinkButton Content="新浪微博：http://weibo.com/geffzhang" NavigateUri="http://weibo.com/geffzhang" TargetName="_blank"></HyperlinkButton>
                
                <TextBlock TextWrapping="Wrap" Text="  © Shanyou Zhang 2011. 版权所有."/>
            </StackPanel>
        </controls:PanoramaItem>

    </controls:Panorama>

    
    <!--Panorama-based applications should not show an ApplicationBar-->
</UserControl>
